package org.zjx.swing.bean;

import lombok.Data;

@Data
public class ColorRecord {
    boolean checked = false;
    int r, g, b;
    int deviationR, deviationG, deviationB;

    public ColorRecord(int r, int g, int b, int deviationR, int deviationG, int deviationB) {
        this.r = r;
        this.g = g;
        this.b = b;
        this.deviationR = deviationR;
        this.deviationG = deviationG;
        this.deviationB = deviationB;
    }

    public boolean equals(ColorRecord colorRecord) {
        return this.r == colorRecord.r && this.g == colorRecord.g && this.b == colorRecord.b
                && this.deviationR == colorRecord.deviationR && this.deviationG == colorRecord.deviationG;
    }

    @Override
    public String toString() {
        return (checked ? "[✔] " : "[ ] ") + "RGB(" + r + "," + g + "," + b + ") ± (" + deviationR + "," + deviationG + "," + deviationB + ")";
    }
}